part of 'page.dart';

class _MenuPageWlocStateFactory {
  const _MenuPageWlocStateFactory._internal();

  static const _instance = _MenuPageWlocStateFactory._internal();

  factory _MenuPageWlocStateFactory() {
    return _instance;
  }

  _MenuPageWlocState create({
    required bloc.MenuPageBlocState blocState,
  }) {
    final anyPurchaseActionReasonable = blocState.purchasePageOpeningActionReasonable ||
        blocState.subscriptionManagementActionReasonable ||
        blocState.purchaseRestorationActionReasonable ||
        blocState.paymentThroughWebsiteActionReasonable ||
        blocState.iosPaymentBySimCardPageOpeningActionReasonable;

    return _MenuPageWlocState(
      user: blocState.user,
      anyPurchaseActionReasonable: anyPurchaseActionReasonable,
      purchasePageOpeningActionReasonable: blocState.purchasePageOpeningActionReasonable,
      subscriptionManagementActionReasonable: blocState.subscriptionManagementActionReasonable,
      purchaseRestorationActionReasonable: blocState.purchaseRestorationActionReasonable,
      paymentThroughWebsiteActionReasonable: blocState.paymentThroughWebsiteActionReasonable,
      iosPaymentBySimCardPageOpeningActionReasonable:
          blocState.iosPaymentBySimCardPageOpeningActionReasonable,
      accountDeletionActionReasonable: blocState.accountDeletionActionReasonable,
      availableEmailApps: blocState.availableEmailApps,
    );
  }
}
